var staid = window.location.search.slice(window.location.search.lastIndexOf("?")+1);
// 向input标签中传值
document.getElementById("staff_id").value = (staid);

function selelt() {
    $.ajax({
        url: "/selectStaff",
        data:{ staff_id:staid },
        type: "POST",
        dataType: "json",
        timeout: 1000,
        cache: false,
        success: function(staff) {
            console.log(staff);
            var stafflist = staff.data.valueOf();
            document.getElementById("staff_name").value = (stafflist.staname);

            if(stafflist.stasex == "女"){ $("#nv").attr("checked","checked"); $("#nan").removeAttr("checked");}
            else{ $("#nan").attr("checked","checked"); $("#nv").removeAttr("checked"); }

            $("#staff_department").append(
                "<option value="+stafflist.depid.depid+">"+stafflist.depid.depname+"</option>"
            );

            $("select").val(stafflist.depid.depid);

            $("#staff_position").append(
                "<option value="+stafflist.posid.posid+">"+stafflist.posid.posname+"</option>"
            );
            $("select").val(stafflist.posid.posid);

            document.getElementById("staff_cell_phone_number").value = (stafflist.staphone);
            document.getElementById("staff_id_number").value = (stafflist.staidentity);
        }
    });
}